package com.xique.park.service.service.impl;

import java.util.List;

import com.xique.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xique.park.mapper.ParkingOrderOnMapper;
import com.xique.park.bean.domain.ParkingOrderOn;
import com.xique.park.service.service.IParkingOrderOnService;

/**
 * 当前在场车辆的停车流水订单Service业务层处理
 *
 * @author xique
 * @date 2021-12-09
 */
@Service
public class ParkingOrderOnServiceImpl implements IParkingOrderOnService {

    @Autowired
    private ParkingOrderOnMapper parkingOrderOnMapper;

    /**
     * 查询当前在场车辆的停车流水订单
     *
     * @param id 当前在场车辆的停车流水订单ID
     * @return 当前在场车辆的停车流水订单
     */
    @Override
    public ParkingOrderOn selectParkingOrderOnById(Long id) {
        return parkingOrderOnMapper.selectParkingOrderOnById(id);
    }

    /**
     * 查询当前在场车辆的停车流水订单列表
     *
     * @param parkingOrderOn 当前在场车辆的停车流水订单
     * @return 当前在场车辆的停车流水订单
     */
    @Override
    public List<ParkingOrderOn> selectParkingOrderOnList(ParkingOrderOn parkingOrderOn) {
        return parkingOrderOnMapper.selectParkingOrderOnList(parkingOrderOn);
    }

    /**
     * 新增当前在场车辆的停车流水订单
     *
     * @param parkingOrderOn 当前在场车辆的停车流水订单
     * @return 结果
     */
    @Override
    public int insertParkingOrderOn(ParkingOrderOn parkingOrderOn) {
        parkingOrderOn.setCreateTime(DateUtils.getNowDate());
        return parkingOrderOnMapper.insertParkingOrderOn(parkingOrderOn);
    }

    /**
     * 修改当前在场车辆的停车流水订单
     *
     * @param parkingOrderOn 当前在场车辆的停车流水订单
     * @return 结果
     */
    @Override
    public int updateParkingOrderOn(ParkingOrderOn parkingOrderOn) {
        parkingOrderOn.setUpdateTime(DateUtils.getNowDate());
        return parkingOrderOnMapper.updateParkingOrderOn(parkingOrderOn);
    }

    /**
     * 批量删除当前在场车辆的停车流水订单
     *
     * @param ids 需要删除的当前在场车辆的停车流水订单ID
     * @return 结果
     */
    @Override
    public int deleteParkingOrderOnByIds(Long[] ids) {
        return parkingOrderOnMapper.deleteParkingOrderOnByIds(ids);
    }

    /**
     * 删除当前在场车辆的停车流水订单信息
     *
     * @param id 当前在场车辆的停车流水订单ID
     * @return 结果
     */
    @Override
    public int deleteParkingOrderOnById(Long id) {
        return parkingOrderOnMapper.deleteParkingOrderOnById(id);
    }

    @Override
    public int deleteParkingOrderOnByParkingSerial(String parkingSerial) {
        return parkingOrderOnMapper.deleteParkingOrderOnByParkingSerial(parkingSerial);
    }

    @Override
    public void updateByParkingSerial(ParkingOrderOn parkingOrderOn) {
        parkingOrderOnMapper.updateByParkingSerial(parkingOrderOn);
    }
}
